Table of Contents
This service is a REST API written in TypeScript that exposes methods to interact with a cache
_Below is an instruction on how to install and set up your app.
-
Clone the repo
git clone https://github.com/nnamdi16/plancraft-coding-challenge.git
-
Cd into the directory
cd plancraft-coding-challenge
-
Install NPM packages and Yarn, in your root directory of the project run the command below
yarn
-
Create an .env and copy the template from .env.sample
touch .env
-
Copy the value inside .env.sample into the .env and fill the values for the necessary config
-
Make sure your server Redis and Redis client is running locally
redis-server - for redis server
redis-commander - for redis client
-
Run the application
yarn run dev
yarn build
- Compiles src code into distyarn start
- Starts the app in production modeyarn run dev
- Starts the app in development modeyarn test
: Run testsyarn run lint
: Lint code using ESLint
Your Name - nwabuokeinnamdi19@gmail.com
Distributed under the MIT License. See LICENSE.txt
for more information.
Table of Contents
This service manages everything that has to with authentication, authorization, roles, permissions, referrals
This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.
_Below is an instruction on how to install and set up your app.
-
Clone the repo
git clone https://github.com/Evea01/evea-auth-service.git
-
Cd into the directory
cd evea-auth-service
-
Install NPM packages and Yarn, in your root directory of the project run the command below
yarn
-
Create an .env and copy the template from .env.sample
touch .env
-
Copy the value inside .env.sample into the .env and fill the values for the necessary config
-
Make sure your Mongodb and RabbitMQ is running locally
-
Run the application
yarn run dev
-
Clone the repo
git clone https://github.com/your_username_/Project-Name.git
-
Cd into the directory
cd Project-Name
-
Create an .env
touch .env
-
Copy the value inside .env.sample into the .env and fill the values for the necessary config
-
Run the application
docker build -t docker-username/project-name .
docker run -it -p 30100:30100 docker-username/project-name
For documentation, please refer to the API Documentation
yarn build
- Compiles src code into distyarn start
- Starts the app in production modenpm run dev
- Starts the app in development modeyarn test
: Run testsyarn run lint
: Lint code using ESLintyarn run docs:api
- generates API docs
Visit http://localhost:9000/rest-docs for API documentation
Your Name - info@evea.africa
Distributed under the MIT License. See LICENSE.txt
for more information.
To learn more about clean architecture, please read this article https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
- Project Structure (adopted from Clean Architecture)
- Dependency Injection
- API Documentation using https://apidocjs.com/
- MongoDB setup
- Testing setup
- Continous Integration Github action
- Configured Express server
- Compliance with 12 factor app
- Process manager
- app: App contains the use cases of the system. A use case can contain business logic for accomplishig a specific goal. Similar usecases can be grouped together in directories e.g RegisterUser, VerifyUser can be grouped under "users". :warning: NOTE: use-cases should NEVER communicate with any external service such as a database directly. Instead, they should call an interface.
- config: Environment specific configurations for the application e.g Database connection options, payment providers, etc. All files created in
config
directory are automatically loaded and exported to different application modules. - domain: Domain contains the core business logic. A domain here is the real-world context in which you're attempting to solve a problem using software i.e the business thee app will be used for. An entity can be an object with methods, or it can be a set of data structures and functions that mirror their real life counterparts. Example of entities in the e-commerce domain might be Customer, Product, Cart, etc. :warning: NOTE: entities should NEVER communicate with any external service such as a database directly.
- infastructure: Infastructure contains the logics to commuicate with all third party assisting application
- interface: Inerface contains everything has to do with the Application Entry and route handlers
- interfaces: Interfaces are delivery mechanisms for your app i.e how users access your app. For example, through a REST API, gRPC server, GraphQL. In this example, we are delivering our application using Express web framework for Nodejs.
- scripts: One time scripts go here. Read https://12factor.net/admin-processes to learn more
Request
curl --location --request GET 'http://localhost:30200/v1/project/fame' \
--data-raw ''
Response
{
"success": true,
"status_code": 200,
"message": "success",
"data": [
{
"name": "fame",
"description": "Non quibusdam labore reiciendis odit soluta et minus.\nDolor qui ea dolores consequatur qui eos natus quo.\nAsperiores nihil quia id reprehenderit.",
"id": "5152201653"
}
],
"links": null
}
Request
curl --location --request GET 'http://localhost:30200/v1/project/fame/9117677429' \
--data-raw ''
Response
{
"success": true,
"status_code": 200,
"message": "success",
"data": {
"name": "fame",
"description": "Non quibusdam labore reiciendis odit soluta et minus.\nDolor qui ea dolores consequatur qui eos natus quo.\nAsperiores nihil quia id reprehenderit.",
"id": "5152201653"
},
"links": null
}
Request
curl --location --request POST 'http://localhost:30200/v1/project' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "power",
"description": "davidbowo1234567891356@yopmail.com"
}'
Response
{
"success": true,
"status_code": 201,
"message": "Project created successfully",
"data": {
"name": "power",
"description": "davidbowo1234567891356@yopmail.com",
"id": "9546627394"
},
"links": null
}
Request
curl --location --request DELETE 'http://localhost:30200/v1/project/9117677429' \
--data-raw ''
Response
{
"success": true,
"status_code": 200,
"message": "Deleted Successfully",
"data": null,
"links": null
}
Request
curl --location --request PUT 'http://localhost:30200/v1/project/update/3779117192' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "project",
"description": "Peter Parker sold a stew of little pepper "
}'
Response
{
"success": true,
"status_code": 200,
"message": "Updated Successfully",
"data": {
"name": "project",
"description": "Peter Parker sold a stew of little pepper ",
"id": "3779117192"
},
"links": null
}
Request
curl --location --request DELETE 'http://localhost:30200/v1/project' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Power"
}'
Response
{
"success": true,
"status_code": 200,
"message": "Deleted all Successfully",
"data": null,
"links": null
}