Giter VIP home page Giter VIP logo

cooking-contest's Introduction

Cooking Contest

logo

This is a Svelte app.

It lives at https://github.com/doppelganger9/cooking-contest.

I talked about it in a blog post.

Get started

Note that you will need to have Node.js installed.

Install the dependencies...

cd cooking-contest
npm install

...then start Rollup:

npm run dev

Navigate to localhost:5000. You should see the app running. Edit a component file in src, save it, and reload the page to see your changes.

Deploying to the web

Install firebase-cli if you haven't already:

npm install -g firebase-cli

First time, create a project in Firebase, and do

firebase init

Copy .env.example into .env and change values inside with yours from Firebase console.


hiding sensitive apikeys via dotenv, replace plugin

When building,

  • we rely on dotenv to read a .env file containing all the Firebase's sensitive informations (Api keys, project ID, etc.) and to expose them in process.env.
  • this is then assigned to words in the Rollup-plugin-replace configuration inside rollup.config.js
  • in the end, it replaces the <@FIREBASE_...@> in the firebase.js file with real string values.
  • you won't see my api keys in this repo ๐Ÿคทโ€โ™‚๏ธ (at least, I hope so...)

Once this is done, from within your project folder:

npm run build
firebase auth
firebase deploy

A .firebaserc will be created, do not commit it.

Contributing

See CONTRIBUTING file.

License

See LICENCE file.

Development Cost

At the moment, I've spent 22 26 hours (~4 work days) on this webapp, starting from scratch (no prior knowledge). I'm very impressed by the learning curve, simplicity of the framework and the resulting code is so lean and clean.

  • I started a little playground project on CodeSandbox, then downloaded it and iterated from there, commiting to git.
  • Adding i18n took me half an hour.
  • Adding Routing and an animated side menu took me 2 hours, including reading the docs and using the Svelte REPL to understand how tweening and easing works.
  • Integrating Firebase took me a little more than 8 hours.
  • Playing with CSS, look & feel and design took me a few hours as it is not of my strength, to say the least ๐Ÿ™„.
  • the last 2 hours were used to rebase interactively my local repo a few times to cleanup a bit, removing sensitive API Keys, adding a license, providing a name and description in package.json. You are seeing the end result.

2020 Update

  • (+1h) Completely refactored the source files directory structure, and file names to expose features, business and mockable infrastructure.
  • (+1h) added a mock implementation to replace Firebase Auth and Firestore for future E2E testing
  • (+30min) added and configured Cypress to begin writing E2E tests.
  • (+1h30) wrote first E2E tests, disabling service workers and adding data-e2e attribute to select things in tests the correct way
  • (+15min) ran npm audit fix a few times
  • (+30min) added code coverage generated from E2E tests

Future plans

This repository and project is still missing on CI/CD features to automatically build, test and publish app, and also manage dependency updates automatically.

I'll see to that in the future.

cooking-contest's People

Contributors

dependabot[bot] avatar doppelganger9 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.