Medieval items Store, in the format of an API, following the MSC architecture (Model -> Service -> Controller), where you can do the basic operations you can do in a database (CRUD). That's my first project using Typescript 💙
In this project, I was able to:
- Configure a Node.js project with Typescript;
- Create an Express application using Typescript;
- Use classes and interfaces to structure the MSC layers;
- Declare variables and functions with Typescript typing;
TypeScript | Express | Node.JS | MySQL | JWT | Joi | Docker | Insomnia |
---|---|---|---|---|---|---|---|
- Clone the repository and enter it
git clone git@github.com:ImVictorM/Smith-API.git && cd Smith-API
You must have docker and docker-compose installed
- Get the containers running
docker-compose up -d
- Enter the server's container
docker exec -it trybesmith bash
- Install the dependencies
npm install
- (Optional) Create/recreate and populate the database
if this step fails, wait a while untill the mysql container is running propperly
npm run db:create
- Start the server
npm run start
---- or ----
npm run dev (with nodemon)
You must have node and MySQL installed
- Install the dependencies
npm install
-
Rename the file
.env.example
to.env
-
(Optional) Create/recreate and populate the database
npm run db:create
- Start the server
npm run start
---- or ----
npm run dev (with nodemon)
Click here to export automatically:
Or just import the file insomniaRoutes.json
inside your environment: https://docs.insomnia.rest/insomnia/import-export-data