Skip to content

AndromedaTechnology/startedincroatia-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Started In Croatia.com

Started In Croatia Logo

Best of Croatia


Heroku
Node TypeScript Docker Jest
Medium Twitter Patreon Buymeacoffee

API for StartedInCroatia [Github - Frontend].

Started in Croatia.

Open-Source.

1. Technology

  • TypeScript
  • Koa.js
  • Database: MongoDB: Mongoose
  • Config: Dotenv, Joi
  • Testing: Jest: SuperTest, MongoDBMemoryServer
  • Docker: MongoDB

2. Features

  • 🥰 Link CRUD
  • 🔐 JWT auth for Admin actions

3. Run

Docker

Runs MongoDB container.

cd docker
cp .env.example .env
docker-compose up -d

Application

# Return to root
cd ..
cp .env.example .env
npm i
npm run dev

4. Tests

Using Jest Testing Framework.

Jest uses SuperTest and MongoDBMemoryServer.

npm run test

5. Postman

Check out Postman Documentation.

Pre-set environment variables:

  • host
  • admin_password

Dynamic environment variables, automatically set in tests:

  • access_token

6. Protected Routes [Admin access]

Few routes are protected with jwtCheck middleware.

Requests going to these routes require Authorization: Bearer {token} header.

Protected Routes

  • [Link][update,delete]

Getting access token

Endpoint: POST /auth/token.

Body: { password: ADMIN_PASSWORD }.

Admin password

ADMIN_PASSWORD is defined in .env file.

It defaults to secret.

7. Frontend

Written in TypeScript,

using Vue.js and Vuetify.

Join the open-source development - Github - StartedInCroatia - Frontend.

Check the live version at startedincroatia.com.

8. Social


Crafted with ❤️
by contributors around the 🌍 World and 🌌 Andromeda.