Giter VIP home page Giter VIP logo

repair-labs's Introduction

Repair Lab Tracker

A repair tracker for Repair Lab and other repair cafes.

Stack

  • Typescript
  • Next.JS for frontend + backend
  • Prisma as the ORM
  • Postgres (Docker) for local DB
  • Mocha + Chai for testing
  • Clerk for auth
  • TailwindCSS for styling
  • ESLint + Prettier for linting

Getting Started

First, install Node (either is fine) and Docker.

Then, install the dependencies:

npm install

Duplicate the .env.local.example file as .env.local, .env.example file as .env and fill in the values found in the Discord.

If you're on Windows, change localhost to host.docker.internal for the DATABASE_URL and DATABASE_URL_DIRECT in .env.local and .env.

Now run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Database

To spin up the local db instances, install Docker and run:

docker compose up

Or if you want to keep using the current terminal...

docker compose up -d

By default, it's configured to run one on port 5432 for local development.

Don't forget to stop the containers!

docker compose down

Prisma

Development

When you make changes to the schema, you should sync the Prisma client with it. Run:

npx prisma db push

And maybe restart the Typescript server in VSCode (CMD + SHIFT + P then search "restart") if it keeps complaining.

You can continue to push changes as you work and the Prisma client will continue to give you correctly typed stuff, and it will not generate a migration file.

Migration

When you're happy with your schema and everything works, run:

npx prisma migrate dev

This will create a migration which is saved to prisma/migrations.

Studio

If you want to see the data or play around with it:

npx prisma studio

Testing

Make sure you've started the Docker container.

npm run test

repair-labs's People

Contributors

dct0 avatar ellenxxxiao avatar huixin-tw avatar justinliangg avatar yelnats8 avatar valtyx13 avatar chloetychang avatar bobojeager avatar nicholaschoong avatar latrodexia avatar lilylyi avatar 0xjuaan avatar aariflamat avatar adrianolr avatar dominictdavies avatar bunchofcapital avatar junhyap avatar yylocky avatar bibyen avatar wintelestr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.