Skip to content

Commit c0073e1

Browse files
chore: eslint, prettier config setup
1 parent 1030af6 commit c0073e1

38 files changed

+2801
-996
lines changed

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
coverage
4+
.env

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"endOfLine": "lf"
8+
}

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
11
# AFOS-API
2-
This is the backend API for the African Open Source(AFOS) project. AFOS is a platform that showcases open source projects from Africa and provides a platform for developers to showcase their skills.
32

3+
This is the backend API for the African Open Source(AFOS) project. AFOS is a platform that showcases open source projects from Africa and provides a platform for developers to showcase their skills.
44

55
## Architecture
6+
67
This is a monorepo that contains the backend API for the AFOS project. The backend API is built using Node.js, Express, and MySQL. The backend API is responsible for handling all the requests from the frontend. Tools and technologies used in this project include:
8+
79
- [Node.js](https://nodejs.org/en): A JavaScript runtime built on Chrome's V8 JavaScript engine.
810
- [Express](https://expressjs.com/): A web application framework for Node.js.
911
- [MySQL](https://www.mysql.com/): A relational database management system.
10-
- [Sequelize](https://sequelize.org/): A promise-based Node.js ORM for MySQL.
12+
- [Sequelize](https://sequelize.org/): A promise-based Node.js ORM for MySQL.
1113
- [JWT](https://jwt.io/): A JSON Web Token library for node.js.
1214
- [Zod](https://zod.dev/): A TypeScript-first schema validation library.
1315
- [Nodemailer](https://nodemailer.com/): A module for Node.js applications to allow easy as cake email sending.
14-
- [Docker](https://www.docker.com/): A platform for developers and sysadmins to build, ship, and run distributed applications.
16+
- [Docker](https://www.docker.com/): A platform for developers and sysadmins to build, ship, and run distributed applications.
1517
- [Jest](https://jestjs.io/): A delightful JavaScript Testing Framework with a focus on simplicity.
1618

1719
[![AFOS Architecture](/public/images/AFOS%20Arch%20Diagram.png)](https://dbdiagram.io/d/67299654e9daa85aca52308f)
1820

19-
2021
## Database Diagram
22+
2123
This is the database diagram for the AFOS project. The database is built using MySQL. The schema diagram below shows the tables in the database and the relationships between them.
2224

2325
[![AFOS Database Diagram](/public/images/AFOS%20DB.png)](https://dbdiagram.io/d/67299654e9daa85aca52308f)
2426

2527
## How to setup project
28+
2629
- Clone the repository.
2730
- Run `npm install` to install all dependencies.
2831
- Create a `.env` file in the root directory and copy the contents of `.env.example` into it. Fill the variables with the required values.
2932
- Run `npm run dev` to start the server.
3033

3134
## How to run tests
35+
3236
- Run `npm run test` to run all tests.
3337
- Run `npm run test:watch` to run all tests in watch mode.
3438
- Run `npm run test:coverage` to run all tests and generate a coverage report.
3539

3640
## Contributing
37-
Contributions are welcome! Please feel free to open an issue or submit a pull request. Make sure to follow the [Contributing Guidelines](CONTRIBUTING.md) before submitting a pull request.
41+
42+
Contributions are welcome! Please feel free to open an issue or submit a pull request. Make sure to follow the [Contributing Guidelines](CONTRIBUTING.md) before submitting a pull request.

eslint.config.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import globals from 'globals';
2+
import js from '@eslint/js';
3+
import eslintPluginPrettier from 'eslint-plugin-prettier';
4+
import prettierConfig from 'eslint-config-prettier';
5+
6+
export default [
7+
js.configs.recommended,
8+
prettierConfig,
9+
{
10+
files: ['**/*.js'],
11+
languageOptions: {
12+
ecmaVersion: 2022,
13+
sourceType: 'module',
14+
globals: {
15+
...globals.node,
16+
},
17+
},
18+
plugins: {
19+
prettier: eslintPluginPrettier,
20+
},
21+
rules: {
22+
'prettier/prettier': 'error',
23+
'no-console': 'warn',
24+
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
25+
'no-duplicate-imports': 'error',
26+
'no-template-curly-in-string': 'error',
27+
'prefer-const': 'error',
28+
'require-await': 'error',
29+
'no-return-await': 'error',
30+
},
31+
},
32+
];

0 commit comments

Comments
 (0)