Skip to content

Urigo/accounter-fullstack

Repository files navigation

Accounter

Manage your taxes.

Getting started

  1. Switch to the correct version of Node.js:
nvm use $(cat .node-version)
  1. Install dependencies:
yarn install
  1. Create .env file:
cp .env.template .env
  1. Run setup:
yarn local:setup
  1. Run client and server:
yarn build
yarn client:dev
yarn server:dev
  1. Visit http://localhost:3001/ and sign in. The credentials to log in are in your .env file under AUTHORIZED_USERS. Set the hashed password in the .env file. e.g. replace SECRET with $2b$10$SuqbDX5r6qZidiMbAcGnFOPloNQSRQrLEPShZjplabtfdN.QzS4ba. And then use the password SECRET to log in.

  2. Seed the database with your business details. Edit scripts/seed.ts with your info, then run yarn seed.

Node ES Modules with TypeScript

Latest Typescript and Node - as bare-bone as possible example app

I wanted to start a simple Node project where I can install the latest things I want and using as little compilation from Typescript as possible.

I remembered Node announced Node 13 support ESModules without experimental flags, checked out the official documentation but couldn't find a simple bare bone example, so maybe that would help someone.

I've committed the dist folder as well to see how the output from Typescript.

Would love suggestions on how to make it better or to point to a better example!

What I've done (so you can tell me what I should have done...)

Node

TypeScript

  • "module": "esnext": Make Typescript output ES Modules
  • "target": "es2020": Highest target (from 3.8.0-beta)

Run app

  1. Install latest Node (Notice that I've placed the engines field on package.json so try to make sure you have the exact version or simply delete it from package.json
  2. Install dependencies - yarn
  3. Compile with tsc -w and run Node with nodemon - yarn dev
  4. You can also use yarn compile and yarn start separately

Want to import from a commonjs package?

Here is a branch of the example with including a commonjs pacakge (pg):

https://github.com/Urigo/typescript-node-es-modules-example/commit/98304173e964713955be3a92b4e355a857376dca

The renovate.json file has nothing to do with the project itself. It's a file to activate RenovateBot to automatically PR this repository when a new version of any dependency of that project has been published

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published