I've been doing a ton of work cleaning up the repository for the Utopian API. Unused routes and dead code have been removed as a result. The repository root is now a lot tidier. All of the scripts used are now located under the src folder.
The Mongoose models are now strictly typed thanks to Typescript. This means refactoring any of the DB functionality will be much easier since you will see a compilation error. The project in its entirety is now ready for strict typing.
MONGO_HOST is no longer hardcoded in the NPM scripts. It must now be specified in the environment variables.
All project dependencies have been updated. Babel has been dropped entirely in favor of Typescript. This means that all the unit tests have been converted to Typescript as well.
Logging has been improved. The output formatting of express logs have been changed. There is no more JSON output. If there's an error in a request it will be logged accordingly and is now easy to get to. No longer is it a monster to go through the logs to see where things can go wrong. The unnecessary Morgan logger has been removed. Winston is the only primary logging system now used.
View all the commits at once: https://github.com/utopian-io/api.utopian.io/commits/master
Commits:
- https://github.com/utopian-io/api.utopian.io/commit/144f13acb2b5cc791c41ccb182a67afaeeae101f (Fix assigned_pool being disregarded, causing a compilation error)
- https://github.com/utopian-io/api.utopian.io/commit/fcf26e6a314ca75d025381968819397971420a82 (Remove MONGO_HOST hardcode from NPM scripts)
- https://github.com/utopian-io/api.utopian.io/commit/571e0f7aaeba8dd2be9d7a228c0dec1b307359d7 (Fix namespace import in user.model.ts)
- https://github.com/utopian-io/api.utopian.io/commit/32d59ca60568e024b229caf3de39ca2a2d03d264 (Cleanup a lot of unused functionality)
- https://github.com/utopian-io/api.utopian.io/commit/6d4cc6ae15b40bf354a9bd46cad6f98473d3e5a9 (Use typescript for unit testing)
- https://github.com/utopian-io/api.utopian.io/commit/064544dce18df7a8358edd47fcb2f3a77f58930f (Update deps)
- https://github.com/utopian-io/api.utopian.io/commit/b27d07ca383d20c8c86cfa898d4b83e7b0618c02 (Update package lock)
- https://github.com/utopian-io/api.utopian.io/commit/023395068079cf4605f1d307bf9d6ad20f3db7ec (Remove morgan logger)
- https://github.com/utopian-io/api.utopian.io/commit/1295327efb9e9501ecdb86c5f6098da1c08c9bc0 (Improve logging)
- https://github.com/utopian-io/api.utopian.io/commit/1d3dacbb50b3c650d993ab2aadfc5820ca0367a9 (Remove unused auth endpoint)
- https://github.com/utopian-io/api.utopian.io/commit/0f3f5013201e9c567173ce82cdc4102319f51203 (Clean up dependencies)
- https://github.com/utopian-io/api.utopian.io/commit/956eb0c5102cd8210078f216b9bf6687af1779c5 (Use strict typing for mongoose schemas)
- https://github.com/utopian-io/api.utopian.io/commit/4297a8d04ec39a6404f181bfe04ece8b74922d07 (Log any errors when retrieving content during the API creation process)
- https://github.com/utopian-io/api.utopian.io/commit/9aa4a111ebf9966f9dba2a579d62c837eab6e0a1 (Reduce verbosity of 404 errors)
- https://github.com/utopian-io/api.utopian.io/commit/6e7ac221ff5062985dbc557c25596eaa0584c88e (Enable basic logging to correlate requests with potential errors)
- https://github.com/utopian-io/api.utopian.io/commit/4dd6d4c5863dbfbf1e8cba4281a231f532b52520 (Provide further details when an error occurs processing an HTTP request)
Posted on Utopian.io - Rewarding Open Source Contributors